
class P900_39643 {

	static long[] results = new long[51];
	
	public static void main(String[] args) {
		
		results[0] = 1;
		results[1] = 1;
		
		for (int k = 2; k < 51; k++) {
			results[k] = results[k-1] + results[k-2];
//			System.out.println(results[k]);
		}

		while (true) {
			int i = Integer.parseInt(readLn());
			if (i == 0) break;
			System.out.println(results[i]);
		}
		
	}
	
    static String readLn() {
        String newLine = System.getProperty("line.separator");
        StringBuffer buffer = new StringBuffer();
        int car = -1;
        try {
            car = System.in.read();
            while ((car > 0) && (car != newLine.charAt(0))) {
                buffer.append((char) car);
                car = System.in.read();
            }
            if (car == newLine.charAt(0))
                System.in.skip(newLine.length() - 1);
        } catch (java.io.IOException e) {
            return (null);
        }
        if ((car < 0) && (buffer.length() == 0))
            return (null);
        return (buffer.toString()).trim();
    }
	
}
